<html>
<head><meta charset="utf-8"><title>adding dependencies to rustc · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html">adding dependencies to rustc</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226259826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226259826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226259826">(Feb 13 2021 at 18:30)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> <span class="user-mention" data-user-id="116083">@pnkfelix</span> I've been assigned <a href="https://github.com/rust-lang/rust/issues/82057">#82057</a> which adds a new dependency to the compiler - it seems reasonable to me but <a href="https://rustc-dev-guide.rust-lang.org/crates-io.html?highlight=dependency#cratesio-dependencies">our current policy on this</a> is a <code>TODO</code> comment as far as I can tell - any thoughts?</p>



<a name="226262047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226262047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226262047">(Feb 13 2021 at 19:17)</a>:</h4>
<p>Whatever policy we have is enforced by CI – there's a check for license compatibility. Unlike with the standard library dependencies, there are no other major requirements for crate usage in the compiler AFAIR.</p>



<a name="226262049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226262049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226262049">(Feb 13 2021 at 19:17)</a>:</h4>
<p>Could be wrong though.</p>



<a name="226262438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226262438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226262438">(Feb 13 2021 at 19:26)</a>:</h4>
<p>We enforce that new deps aren't added by a tidy check, but I assumed it was just a whilelist - wasn't sure if we should just add to that, given that the policy mentions concerns about maintainership and licensing, etc.</p>



<a name="226262665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226262665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226262665">(Feb 13 2021 at 19:32)</a>:</h4>
<p>I'm pretty sure license is still checked separately. There's <a href="https://github.com/rust-lang/rust/blob/7e0241c63755ea28045d512b742f50b307874419/src/tools/tidy/src/deps.rs#L57-L60">https://github.com/rust-lang/rust/blob/7e0241c63755ea28045d512b742f50b307874419/src/tools/tidy/src/deps.rs#L57-L60</a> which says</p>
<blockquote>
<p>Avoid adding to the list if possible.</p>
</blockquote>
<p>but given the number of entries in that list I'm wondering if we should remove that sentence at this point.</p>



<a name="226262693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/226262693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#226262693">(Feb 13 2021 at 19:33)</a>:</h4>
<p>I for one would love to see e.g. <code>rustc_serialize</code> replaced with <code>serde</code>.</p>



<a name="227031593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/227031593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#227031593">(Feb 19 2021 at 21:31)</a>:</h4>
<p>Great question <span class="user-mention" data-user-id="116107">@davidtwco</span>! I'm actually running into this myself. </p>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> Do you have any thoughts about what process we should use to vet <a href="http://crates.io">crates.io</a> dependencies?</p>
<p>(cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> in case you have thoughts as well <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> )</p>



<a name="227054504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/227054504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#227054504">(Feb 20 2021 at 01:21)</a>:</h4>
<p>I think these kind of changes would warrant an MCP, but the two gating factors are: license and how well maintained the crate is. If there are _any_ concerns about the dep we need to ask ourselves whether we'd be fine with taking ownership of it if push came to shove.</p>



<a name="227955002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/227955002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#227955002">(Feb 26 2021 at 16:44)</a>:</h4>
<p>I think in general we should have a more concrete policy with regards to how we use external crates in rustc. I'd like to have a design meeting around clarifying this policy but before then, if anyone has opinions about this topic, please let me know or comment here.</p>



<a name="227955035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/adding%20dependencies%20to%20rustc/near/227955035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/adding.20dependencies.20to.20rustc.html#227955035">(Feb 26 2021 at 16:44)</a>:</h4>
<p>In the meantime, I don't think we need to hold that PR up for this future policy so I will r+.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>